{extend name="common/common" /}

{block name="style"}
<link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<style media="screen">
.tips{
	border:1px solid #E6A23C;
	color:#E6A23C;
	font-size: 16px;
	box-shadow: #E6A23C 0px 2px 12px 0px;
	font-family: "宋体";
	margin-bottom: 25px;
}
.table.table-bordered.table-striped tr td {
	line-height: 26px;
}
.ibox-title h5{
	float:none;
	font-weight: 999;
}
.span-danger{
	font-family: "宋体";
	font-weight: 999;
}
.el-radio-button--mini .el-radio-button__inner {
	padding: 7px 10px;
}
.table-public-service-system{
	min-width: 1550px;
}
.el-textarea__inner {
	line-height: 0.7;
}
label{
	margin-bottom: 0;
}
.el-dialog__body input[type="file"]{
	display: none;
}
</style>
{/block}

{block name="component"}
{/block}

{block name="content"}
<el-row>
<el-col :md="12">
<div class="ibox-title">
    <h5>
		<span class="span-primary">{{form.departName}}</span>
		映潮指数：县域电商整体交易
	</h5>
</div>
<div class="ibox-content">
	<el-form :model="form" :rules="rules" ref="form" label-width="110px" inline>
		<el-form-item label="填表人" prop="linkMan">
			<el-input size="mini" v-model="form.link_man"></el-input>
		</el-form-item>
		<el-form-item label="电话" prop="linkType">
			<el-input size="mini" v-model="form.link_type"></el-input>
		</el-form-item>
		<el-form-item label="报表日期" prop="rpt_date">
			<el-input size="mini" v-model="form.rpt_date" disabled></el-input>
		</el-form-item><br>
		<table class="table table-bordered table-striped text-center">
			<tr>
				<th class="text-center">标号</th>
				<th class="text-center">指标</th>
				<th class="text-center" width="200">数值</th>
			</tr>
			<tr>
				<td>1</td>
				<td class="text-right">网络交易额（亿）</td>
				<td>
					<el-input type="number" size="mini"  min="0"
					v-model="form.tableCT.net_trade_money"></el-input>
				</td>
			</tr>
			<tr>
				<td>2</td>
				<td class="text-right">网络交易额同比（%）</td>
				<td>
					<el-input type="number" size="mini" v-model="form.tableCT.net_trade_ratio_basis"></el-input>
				</td>
			</tr>
			<tr>
				<td>3</td>
				<td class="text-right">网络交易额环比（%）</td>
				<td>
					<el-input type="number" size="mini" v-model="form.tableCT.net_trade_ratio_chain"></el-input>
				</td>
			</tr>
			<tr>
				<td>4</td>
				<td class="text-right">网络交易额在云南中的排名</td>
				<td>
					<el-input type="number" size="mini"  min="0" v-model="form.tableCT.net_trade_rank"></el-input>
				</td>
			</tr>
			<tr>
				<td>5</td>
				<td class="text-right">网络零售额（亿）</td>
				<td>
					<el-input type="number" size="mini"  min="0"
					v-model="form.tableCT.net_retail_money"></el-input>
				</td>
			</tr>
			<tr>
				<td>6</td>
				<td class="text-right">网络零售额同比（%）</td>
				<td>
					<el-input type="number" size="mini"
					v-model="form.tableCT.net_retail_ratio_basis"></el-input>
				</td>
			</tr>
			<tr>
				<td>7</td>
				<td class="text-right">网络零售额环比（%）</td>
				<td>
					<el-input type="number" size="mini" v-model="form.tableCT.net_retail_ratio_chain"></el-input>
				</td>
			</tr>
			<tr>
				<td>8</td>
				<td class="text-right">网络零售额在云南中的排名</td>
				<td>
					<el-input type="number" size="mini"  min="0" v-model="form.tableCT.net_retail_rank"></el-input>
				</td>
			</tr>
			<tr>
				<td>9</td>
				<td class="text-right">实物型网络零售额（亿）</td>
				<td>
					<el-input type="number" size="mini"  min="0" v-model="form.tableCT.industry_money"></el-input>
				</td>
			</tr>
			<tr>
				<td>10</td>
				<td class="text-right">实物型网络零售额在云南中的排名</td>
				<td>
					<el-input type="number" size="mini"  min="0" v-model="form.tableCT.industry_rank"></el-input>
				</td>
			</tr>
			<tr>
				<td>11</td>
				<td class="text-right">服务型网络零售额（亿）</td>
				<td>
					<el-input type="number" size="mini"  min="0" v-model="form.tableCT.service_money"></el-input>
				</td>
			</tr>
			<tr>
				<td>12</td>
				<td class="text-right">服务型网络零售额在云南中的排名</td>
				<td>
					<el-input type="number" size="mini" min="0" v-model="form.tableCT.service_rank"></el-input>
				</td>
			</tr>
		</table>
		<p class="text-center">
			<el-button type="danger" plain @click="reset">重置表格</el-button>
			<el-button type="primary" plain @click="save">保存表格</el-button>
		</p>
	</el-form>
</div>
</el-col>
</el-row>
{/block}

{block name="script"}
<script type="text/javascript">
var main = new Vue({
	el:"#main",
	data:{
		loading:false,
		form:{
			depart_id:"{$depart.id}",
			depart_name:"{$depart.name}",
			rpt_date:"{$rpt_date}",
			link_man:"",
			link_type:"",
			tableCT:{
				net_trade_money:"",net_trade_ratio_basis:"",
				net_trade_ratio_chain:"",net_trade_rank:"",
				net_retail_money:"",net_retail_ratio_basis:"",
				net_retail_ratio_chain:"",net_retail_rank:"",
				industry_money:"",industry_rank:"",
				service_money:"",service_rank:"",
			}
		},
		form_reset:{
			depart_id:"{$depart.id}",
			depart_name:"{$depart.name}",
			rpt_date:"{$rpt_date}",
			link_man:"",
			link_type:"",
			tableCT:{
				net_trade_money:"",net_trade_ratio_basis:"",
				net_trade_ratio_chain:"",net_trade_rank:"",
				net_retail_money:"",net_retail_ratio_basis:"",
				net_retail_ratio_chain:"",net_retail_rank:"",
				industry_money:"",industry_rank:"",
				service_money:"",service_rank:"",
			}
		},
		rules:{
			link_man:[{required:true,message:'填表人不能为空',trigger:['blur','change']}],
			link_type:[{required:true,message:'联系方式不能为空',trigger:['blur','change']}],
		}
	},
	methods:{
		reset() {
			this.$confirm('确定要重置吗？', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			}).then(() => {
				this.form.tableCT = this.form_reset.tableCT;
			}).catch(() => {});
		},
		AjaxResponse(res) {
			if(res.code == 1){
				main.$notify({title:"成功",type:"success",message:res.msg})
			}else{
				main.$notify.error({title:"错误",message:res.msg})
			}
		},
		save() {
			var param = this.form;
			$.post("{:url('Icdata/saveTable_all_county')}",param,function(res){
				main.AjaxResponse(res);
			});
		}
	}
})
</script>
{/block}
